// 订单管理接口
const orderApi = {
    // 订单基础信息
    getOrderDetail: (orderNo) => {
        return axios.get(`/order/${orderNo}`);
    },
    createOrder: (orderData) => {
        return axios.post('/order', orderData);
    },
    updateOrder: (orderData) => {
        return axios.put('/order', orderData);
    },
    cancelOrder: (cancelData) => {
        return axios.post('/order/cancel', cancelData);
    },
    listOrders: (current = 1, size = 10) => {
        return axios.get(`/order/list?current=${current}&size=${size}`);
    },

    // 订单支付信息
    getOrderPayment: (orderNo) => {
        return axios.get(`/order/payment/${orderNo}`);
    },
    createPayment: (paymentData) => {
        return axios.post('/order/payment', paymentData);
    },
    queryPaymentStatus: (orderNo) => {
        return axios.get(`/order/payment/status/${orderNo}`);
    },
    listPayments: (current = 1, size = 10) => {
        return axios.get(`/order-payment/list?current=${current}&size=${size}`);
    },

    // 订单优惠券信息
    getOrderCoupon: (orderNo) => {
        return axios.get(`/order/coupon/${orderNo}`);
    },
    applyCoupon: (couponData) => {
        return axios.post('/order/coupon/apply', couponData);
    },
    removeCoupon: (orderNo) => {
        return axios.post(`/order/coupon/remove/${orderNo}`);
    },
    listCoupons: (current = 1, size = 10) => {
        return axios.get(`/order-coupon/list?current=${current}&size=${size}`);
    },

    // 订单评价信息
    getOrderReview: (orderNo) => {
        return axios.get(`/order/review/${orderNo}`);
    },
    submitReview: (reviewData) => {
        return axios.post('/order/review', reviewData);
    },
    updateReview: (reviewData) => {
        return axios.put('/order/review', reviewData);
    },
    listReviews: (current = 1, size = 10) => {
        return axios.get(`/order-review/list?current=${current}&size=${size}`);
    },

    // 订单退款信息
    getOrderRefund: (orderNo) => {
        return axios.get(`/order/refund/${orderNo}`);
    },
    applyRefund: (refundData) => {
        return axios.post('/order/refund/apply', refundData);
    },
    updateRefund: (refundData) => {
        return axios.put('/order/refund/update', refundData);
    },
    listRefunds: (current = 1, size = 10) => {
        return axios.get(`/order-refund/list?current=${current}&size=${size}`);
    }
}; 